package com.tanhua.server.controller;

import com.alibaba.fastjson.JSON;
import com.tanhua.domain.vo.Dimension;
import com.tanhua.domain.vo.QuestionVo;
import com.tanhua.domain.vo.ReportVo;
import com.tanhua.domain.vo.Similar;
import com.tanhua.server.service.SoulService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/testSoul")
public class SoulController {
    @Autowired
    private SoulService soulService;

    /**
     *接口名称：测灵魂-提交问卷（学生实战）
     *
     *接口路径：POST/testSoul
     */
    @PostMapping
    public ResponseEntity<Object> submitQuestion(@RequestBody Map<String, List<Map<String, String>>>answers){

        return soulService.submitQuestion(answers);


    }
    /**
     *接口名称：测灵魂-问卷列表（学生实战）
     *
     *接口路径：GET/testSoul
     */
    @GetMapping
    public ResponseEntity<Object> showQuestions(){
     /*   List<QuestionVo> questionVoList=new ArrayList<>();
         return ResponseEntity.ok(questionVoList);*/
        return soulService.showQuestions();

    }
    /**
     *接口名称：测灵魂-查看结果（学生实战）
     *
     *接口路径：GET/testSoul/report/:id
     */
    @GetMapping("/report/{id}")
    public ResponseEntity<Object> queryResult(@PathVariable("id") String id){

        return soulService.queryResult(id);

    }

}
